# encoding: utf-8
class Notifications < ActionMailer::Base
  default from: "default@example.com"

  #notify student about reseting their own password
  def reset_password(to, login)
    @subject    = t"resetpass.mail.subject"
    @from       = t"forgotpass.mail.general.from"
    @login      = login
    mail(:to      => to,
         :from    => @from,
         :subject => @subject,
         :charset => "utf-8")
  end

  #send email include reset_password to student
  def forgot_password(to, login, reset_password, sent_at = Time.now)
    @subject    = t"forgotpass.mail.subject"
    @from       = t"forgotpass.mail.general.from"
    @login      = login
    @reset_password_data = "/#{login}/#{reset_password}"
    mail(:to      => to,
         :from    => @from,
         :subject => @subject,
         :charset => "utf-8")
  end
end
